package com.webdemo09.action;

import com.opensymphony.xwork2.ActionSupport;
import com.webdemo09.pojo.User;
import com.webdemo09.service.UserService;

public class DeleteUser extends ActionSupport {

	private static final long serialVersionUID = 1L;
	private UserService userService;
	private int id;
	public UserService getUserService() {
		return userService;
	}
	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	@Override
	public String execute() throws Exception {
		User user = userService.getUser(id);
		userService.deleteUser(user);
		return "show";
	}

}
